Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BA-693): Failure of whole image rescanning when there is a misconfigured container registry #3652

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Feb 11, 2025

Fixes #3650, #3700 (BA-693, BA-753).

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue

@jopemachine jopemachine changed the title fix: Wrong exception handling of fetch_repositories fix(BA-693): Wrong exception handling of fetch_repositories Feb 11, 2025
@github-actions github-actions bot added comp:manager Related to Manager component size:XS ~10 LoC labels Feb 11, 2025
@jopemachine jopemachine added the type:bug Reports about that are not working label Feb 11, 2025
@github-actions github-actions bot added size:S 10~30 LoC size:M 30~100 LoC and removed size:XS ~10 LoC size:S 10~30 LoC labels Feb 11, 2025
@jopemachine jopemachine force-pushed the fix_whole_image_rescan_fail_when_misconfigured_registry_row_exist branch from f45646d to da9135b Compare February 11, 2025 07:46
@github-actions github-actions bot added size:S 10~30 LoC and removed size:M 30~100 LoC labels Feb 11, 2025
@jopemachine jopemachine added this to the 23.09 milestone Feb 11, 2025
@jopemachine jopemachine changed the title fix(BA-693): Wrong exception handling of fetch_repositories fix(BA-693): Failure of the whole image rescanning task when there is a misconfigured container registry Feb 11, 2025
@jopemachine jopemachine changed the title fix(BA-693): Failure of the whole image rescanning task when there is a misconfigured container registry fix(BA-693): Failure of the whole image rescanning when there is a misconfigured container registry Feb 11, 2025
@jopemachine jopemachine changed the title fix(BA-693): Failure of the whole image rescanning when there is a misconfigured container registry fix(BA-693): Failure of whole image rescanning when there is a misconfigured container registry Feb 11, 2025
@jopemachine jopemachine marked this pull request as ready for review February 13, 2025 06:23
Copy link
Collaborator

@HyeockJinKim HyeockJinKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions github-actions bot added comp:client Related to Client component comp:common Related to Common component comp:cli Related to CLI component size:L 100~500 LoC and removed size:S 10~30 LoC labels Feb 16, 2025
Comment on lines +72 to +78
BgtaskEvents = (
BgtaskUpdatedEvent
| BgtaskDoneEvent
| BgtaskCancelledEvent
| BgtaskFailedEvent
| BgtaskIssueReportedEvent
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, it seems better to create a PartialSuccessEvent. Instead, for compatibility purposes, Please set the event.name value to bgtask_done and change it together with the frontend work later on.

Comment on lines +398 to +409
issues = []
if event_cls is BgtaskDoneEvent:
tracker_key = f"bgtask.{task_id}"
raw_errors_str = await redis_helper.execute(
redis_producer, lambda r: r.hget(tracker_key, "issues")
)
if raw_errors_str:
try:
issues = json.loads(raw_errors_str)
except Exception:
log.error("Failed to parse bgtask errors from the Redis")
issues = [raw_errors_str]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, it seems that an event should be created and passed through the try-catch in wrapper_task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:cli Related to CLI component comp:client Related to Client component comp:common Related to Common component comp:manager Related to Manager component size:L 100~500 LoC type:bug Reports about that are not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure of the image rescan when there is a misconfigured container registry row
2 participants